<?php

declare(strict_types=1);

namespace App\Job;


use App\Model\Normal;
use App\Service\CallbackMqttService;
use Hyperf\AsyncQueue\Job;

class SendJob extends Job
{
    public string $message;
    /**
     * 任务执行失败后的重试次数，即最大执行次数为 $maxAttempts+1 次
     */
    protected $maxAttempts = 2;

    public function __construct($data)
    {
        $this->data = $data;
    }

    public function handle()
    {
        $result = CallbackMqttService::curlPost($this->data['api_url'],$this->data);
        Normal::logger(json_encode($this->data).'----'.$this->data['api_url'].'----'.$this->data['path'],'order-queue');
    }
}
